package org.xserver.component.core.websocket;

import java.util.Map;
import java.util.Set;

import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
/**
 * 
 * @author Idol
 *
 */
public class WebSocketClient {

    private WebSocketServerHandshaker handshaker ;
    private ChannelHandlerContext channelHandlerContext ;
    /*是否有protocol */
    private boolean hasSubProtocols;
    private boolean isClosed;
    private String uri;
    private String[] protocols;
    private Set<String> topics;
    private Map<String ,Object> reqParam;

    private Long messageId;
    private Long lastAckTime;



    public Map<String, Object> getReqParam() {
        return reqParam;
    }

    public void setReqParam(Map<String, Object> reqParam) {
        this.reqParam = reqParam;
    }

    public WebSocketServerHandshaker getHandshaker() {
        return handshaker;
    }

    public void setHandshaker(WebSocketServerHandshaker handshaker) {
        this.handshaker = handshaker;
    }

    public ChannelHandlerContext getChannelHandlerContext() {
        return channelHandlerContext;
    }

    public void setChannelHandlerContext(ChannelHandlerContext channelHandlerContext) {
        this.channelHandlerContext = channelHandlerContext;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public boolean isHasSubProtocols() {
        return hasSubProtocols;
    }

    public void setHasSubProtocols(boolean hasSubProtocols) {
        this.hasSubProtocols = hasSubProtocols;
    }

    public String[] getProtocols() {
        return protocols;
    }

    public void setProtocols(String[] protocols) {
        this.protocols = protocols;
    }

    public boolean isClosed() {
        return isClosed;
    }

    public void setClosed(boolean closed) {
        isClosed = closed;
    }


    public Set<String> getTopics() {
        return topics;
    }

    public void setTopics(Set<String> topics) {
        this.topics = topics;
    }


    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public Long getLastAckTime() {
        return lastAckTime;
    }

    public void setLastAckTime(Long lastAckTime) {
        this.lastAckTime = lastAckTime;
    }

    public void newLastAckTime() {
        this.lastAckTime = System.currentTimeMillis();
    }

}
